package com.pgeg.listener;

import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.block.OreBlock;
import net.minecraft.sound.BlockSoundGroup;

public class BlockListener {

    /*Ores*/
    public static final Block MANA_CRYSTAL_ORE = new OreBlock(genStoneBlockSettings());
    public static final Block ORICHALCUM_ORE = new OreBlock(genRareOreSettings());
    public static final Block SATURNIUM_ORE = new OreBlock(genRareOreSettings());
    public static final Block BRIMSTONE_ORE = new OreBlock(genRareOreSettings());
    public static final Block MITHRIL_ORE = new OreBlock(genRareOreSettings());
    public static final Block METEORITE_ORE = new OreBlock(genRareOreSettings());
    public static final Block COPPER_ORE = new OreBlock(genStoneBlockSettings());
    public static final Block SILVER_ORE = new OreBlock(genStoneBlockSettings());
    public static final Block AIR_INFUSED_STONE = new OreBlock(genStoneBlockSettings());
    public static final Block FIRE_INFUSED_STONE = new OreBlock(genStoneBlockSettings());
    public static final Block EARTH_INFUSED_STONE = new OreBlock(genStoneBlockSettings());
    public static final Block WATER_INFUSED_STONE = new OreBlock(genStoneBlockSettings());
    public static final Block ORDER_INFUSED_STONE = new OreBlock(genStoneBlockSettings());
    public static final Block ENTROPY_INFUSED_STONE = new OreBlock(genStoneBlockSettings());

    /*MetalBlocks*/
    public static final Block MANA_DUST_BLOCK = new Block(genMetalBlockSettings());
    public static final Block ORICHALCUM_BLOCK = new Block(genMetalBlockSettings());
    public static final Block SATURNIUM_BLOCK = new Block(genMetalBlockSettings());
    public static final Block BRIMSTONE_BLOCK = new Block(genMetalBlockSettings());
    public static final Block METEORITE_BLOCK = new Block(genMetalBlockSettings());
    public static final Block MITHRIL_BLOCK = new Block(genMetalBlockSettings());
    public static final Block COPPER_BLOCK = new Block(genMetalBlockSettings());
    public static final Block SILVER_BLOCK = new Block(genMetalBlockSettings());

    /*Bricks*/
    public static final Block CACTUS_BRICK = new Block(genWoodBlockSettings());
    public static final Block IRON_BRICK = new Block(genStoneBlockSettings());
    public static final Block COAL_BRICK = new Block(genStoneBlockSettings());

    private static FabricBlockSettings genMetalBlockSettings() {
        return FabricBlockSettings.of(Material.METAL).breakByTool(FabricToolTags.PICKAXES, 2).strength(1.5F, 6.0F).sounds(BlockSoundGroup.METAL);
    }

    private static FabricBlockSettings genStoneBlockSettings() {
        return FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES, 2).strength(1.5F, 6.0F).sounds(BlockSoundGroup.STONE);
    }

    private static FabricBlockSettings genRareOreSettings() {
        return FabricBlockSettings.of(Material.STONE).breakByTool(FabricToolTags.PICKAXES, 2).strength(1.5F, 6.0F).sounds(BlockSoundGroup.STONE);
    }

    private static FabricBlockSettings genWoodBlockSettings() {
        return FabricBlockSettings.of(Material.WOOD).breakByTool(FabricToolTags.AXES, 1).strength(2.0F, 3.0F).sounds(BlockSoundGroup.WOOD);
    }
}
